let data = {
  a: 3,
  b: 4,
  c: 5,
};

const observer = (data, item, value) => {
  Object.defineProperty(data, item, {
    get() {
      return value;
    },
    set(val) {
      console.log(`${item}的从${value}变成了${val}`);
      value = val;
    },
  });
};

// ["a", "b", "c"]
Object.keys(data).forEach((item) => {
  observer(data, item, data[item]);
});

console.log(data.a);
data.b = 10;
console.log(data.b);
